package com.designmode.单例模式;

/**
 * 饿汉式
 */
public class Hungry {

    //类加载时候不管有没有被使用都会加载  会浪费空间
    private byte[] data1 = new byte[1024 * 1024 * 1024];
    private byte[] data2 = new byte[1024 * 1024 * 1024];
    private byte[] data3 = new byte[1024 * 1024 * 1024];
    private byte[] data4 = new byte[1024 * 1024 * 1024];


    private Hungry() {

    }

    private final static Hungry HUNGRY = new Hungry();

    public static Hungry getInstance() {
        return HUNGRY;
    }

}

